package com.healthy_software.controller;

import com.healthy_software.dto.HealthPlanDTO;
import com.healthy_software.result.Result;
import com.healthy_software.service.HealthAdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/advice")
public class HealthAdviceController {

    @Autowired
    private HealthAdviceService healthAdviceService;

    @PostMapping("/healthy_advice")
    public Result<HealthPlanDTO> getAllAdvice(@RequestParam("goalId") Long goalId) {
        return healthAdviceService.getHealthPlanByGoalId(goalId);
    }
}
